home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / shell / ncd-0.000 / ncd-0 / ncd-0.9.8 / ncd.txt < prev    next >
Encoding:
Text File  |  1995-05-05  |  11.8 KB  |  397 lines

  1.  
  2.  
  3.  
  4. NCD(1)                               NCD(1)
  5.  
  6.  
  7. NAME
  8.        ncd - Ninux Change Directory: browse & select directories
  9.  
  10.  
  11. SYNOPSIS
  12.        ncd [ -options ]     [ directory ]
  13.  
  14.  
  15. DESCRIPTION
  16.        ncd  is    an  interactive fullscreen directory browser that
  17.        lets you select and change to the  desired  directory.  It
  18.        also  lets you change quickly in non-interactive mode to a
  19.        directory selected in  the  command  line.   ncd     supports
  20.        incomplete  directory  specification  in the command line,
  21.        and is able to perform automatic search in browser mode.
  22.  
  23.        If you provide a directory name in the command  line,  ncd
  24.        will  run  in non-interactive mode, and will try to change
  25.        to the next directory that matches completely or partially
  26.        the specified one.
  27.  
  28.        If you don't provide a directory name in the command line,
  29.        ncd will run in interactive mode. You can  browse  up  and
  30.        down  the  directory  tree,  search  for     a directory, and
  31.        accept or cancel the selection of a  directory  to  change
  32.        to.
  33.  
  34.        To  get    a  faster  response,  ncd  keeps a directory tree
  35.        database in the user's home directory (obtained from $HOME
  36.        environment variable). The database actually consists on a
  37.        couple of files: .ncd_htree, that keeps the directory tree
  38.        starting from the user home directory, and .ncd_ftree that
  39.        keeps the full system directory tree,  starting    from  the
  40.        root  directory    /.  All the home tree stored somewhere in
  41.        the full tree file .ncd_ftree  is  discarded,  and  it  is
  42.        recreated based on the home tree read from .ncd_htree.  In
  43.        this way, the user can add/delete  directories  below  his
  44.        home  directory    and  rebuild  just  the     home .ncd_htree.
  45.        database, avoiding to rebuild the long .ncd_free full sys-
  46.        tem tree.
  47.  
  48.        The program can run in two scope modes: home-scope mode or
  49.        full-scope mode.     In home-scope mode, only the home direc-
  50.        tory tree is available, and the program has no view of any
  51.        directory external to this local tree. In full-scope mode,
  52.        the full system tree starting from / is available for view
  53.        and search operations. Normally the mode is  automatically
  54.        selected based on the current work directory at invocation
  55.        time: home-scope mode is selected if the current directory
  56.        is located under the home directory. Otherwise, full-scope
  57.        is selected. This behaviour can be overriden using command
  58.        line  options.  If  you specify a directory in the command
  59.        line (non-interactive mode) you    can  easily  force  full-
  60.        scope  mode  starting  the  directory name with a slash /.
  61.  
  62.  
  63.  
  64. ncd               20 May 1995                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. NCD(1)                               NCD(1)
  71.  
  72.  
  73.        This does not mean that the directory must hang    from  the
  74.        root  directory;     to  do this, add two slashes, except for
  75.        root directory selection, that just needs one slash.
  76.  
  77.        If the current work directory at invocation  time  is  not
  78.        registered  in  the  program  database files, the database
  79.        (home or full depending on scope     mode)    is  automatically
  80.        rebuilt. This can be overriden using command line options.
  81.  
  82.  
  83. COMMAND LINE OPTIONS
  84.        You can supply command line options to customize some  ncd
  85.        actions.     Options  can  be grouped behind a single -.  You
  86.        can also specify default options in the NCD_OPTS     environ-
  87.        ment  variable,    using  the  same sintax as in the command
  88.        line. Command line options override NCD_OPTS options.
  89.  
  90.        This is a list of the supported command line options:
  91.  
  92.        -f     select  full-scope  mode    (starting  from     /).   On
  93.           rebuild,     both    .ncd_ftree   and  .ncd_htree  are
  94.           rebuilt.
  95.  
  96.        -h     select home-scope mode (starting from  $HOME).   On
  97.           rebuild, only .ncd_htree is rebuilt.
  98.  
  99.        -H     select automatic-scope mode. This will choose full-
  100.           scope or home-scope depending on the current  work-
  101.           ing  directory  at  invocation  time.   This is the
  102.           default scope mode.
  103.  
  104.        -r     force  rebuilding     the  database    (home  or   full,
  105.           depending on the scope mode).
  106.  
  107.        -R     disable  the database forced rebuild.  This cancels
  108.           any previous -r, but does not cancel  an    automatic
  109.           rebuild (use -A to cancel that one).
  110.  
  111.        -a     select  automatic     rebuild  mode.      if  the current
  112.           working directory at invocation time is not in  the
  113.           program  database,  a rebuild is performed (home or
  114.           full, depending on the scope mode).   This  is  the
  115.           default auto-rebuild mode.
  116.  
  117.        -A     disable automatic rebuild mode.
  118.  
  119.        -v     Verbose  on.  Usefull  for debug purposes or if you
  120.           get bored while rebuilding the full tree.
  121.  
  122.        -V     Verbose off. This is the default verbose mode.
  123.  
  124.        -d     dumps directory tree. This will make a nice listing
  125.           of  the  directory  tree    to  stdout (home or full,
  126.           depending on the scope). Just usefull to export the
  127.  
  128.  
  129.  
  130. ncd               20 May 1995                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. NCD(1)                               NCD(1)
  137.  
  138.  
  139.           directory     tree  to  a text file.     The program will
  140.           exit inmediately after the  listing,  returning  an
  141.           error  code (not 0), it will not perform any change
  142.           directory operation.
  143.  
  144.        -D     Cancels any previous -d.
  145.  
  146.        -t     Force text-chars display of the directory tree.  If
  147.           not  forced,  curses  line-art characters are used.
  148.           Curses chars are    nice  on  terminals  that  suport
  149.           line-art characters (as the linux console), but you
  150.           get an ugly view on other terminal  types.  If  you
  151.           use -t, you get a bit better display.
  152.  
  153.        -T     cancels  any previous -t and also cancels automatic
  154.           line-art/text-char select ( -x ).     So  this  forces
  155.           curses chars display.
  156.  
  157.        -x     selects  automatically  line-art/text-chars display
  158.           of the directory tree.  This is the default.
  159.  
  160.        -l     View expanded links ( ldir -> dir/ )
  161.  
  162.        -L     View  compacted  links  (     ldir@    ).  This  is  the
  163.           default.
  164.  
  165.        -? -i  Shows a summary of command line options.
  166.  
  167.  
  168. BROWSER KEYS
  169.        When invoqued in interactive mode, these are the character
  170.        sequences and keys to use the browser.
  171.  
  172.  
  173.        KeyDown or Ctrl+N:
  174.           Move down (next brother).
  175.  
  176.        KeyUp or Ctrl+P:
  177.           Move up (previous brother).
  178.  
  179.        KeyLeft or Ctrl+B:
  180.           Move left (father).
  181.  
  182.        KeyRight or Ctrl+F:
  183.           Move right (son).
  184.  
  185.        KeyHome or Ctrl+A:
  186.           Move to first directory in tree ( $HOME or / ).
  187.  
  188.        KeyEnd or Ctrl+E:
  189.           Move to last descendant of current node.
  190.  
  191.        KeyPgUp or Ctrl+U:
  192.           Move one page up.
  193.  
  194.  
  195.  
  196. ncd               20 May 1995                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. NCD(1)                               NCD(1)
  203.  
  204.  
  205.        KeyPgDn or Ctrl+V:
  206.           Move one page down.
  207.  
  208.        KeyF7 or Ctrl+O:
  209.           Last directory of previous line.
  210.  
  211.        KeyF8 or Ctrl+J:
  212.           First directory of next line.
  213.  
  214.        Ctrl+T:
  215.           Opposite    movement  of  KeyRight.      This     is   not
  216.           KeyLeft.     Keyleft  moves back to the father direc-
  217.           tory.
  218.  
  219.        KeyText (any text key or displayable character):
  220.           Adds the character to the search string. As you add
  221.           chars,  the program will try to match the resulting
  222.           string to a directory in the tree. If no    match  is
  223.           possible,     the  character is rejected. The match is
  224.           partial, so it is not necessary  to  type     a  whole
  225.           directory     name to match it. If you want to force a
  226.           total match, add a final    slash  /  to  the  search
  227.           string.  After you add a slash you can go on adding
  228.           chars, so actually the search is not limited  to    a
  229.           simple  directory     name,    but  can  also search for
  230.           paths.
  231.  
  232.        KeyF9 or Ctrl+K:
  233.           Move to next directory  that  matches  the  current
  234.           search field.
  235.  
  236.        Backspace or Ctrl+H:
  237.           Delete last character from the search field.
  238.  
  239.        Del or Ctrl+D:
  240.           Clears completely the search field.
  241.  
  242.        KeyF5 or Ctrl+L:
  243.           If  the  current    selection is a link, follow it to
  244.           the destination directory.
  245.  
  246.        KeyF6 or Ctrl+G:
  247.           Toggles between viewing expanded links  (     ldir  ->
  248.           dir/  )  and compacted links ( ldir@ ). The initial
  249.           mode is command line selected using -l and -L.  The
  250.           default mode is to show compacted links.
  251.  
  252.        KeyF4 or Ctrl+W:
  253.           Repaint  the  full screen. Use this when some back-
  254.           ground process disturbs your display, or some other
  255.           user tries to write(1) or talk(1) to you.
  256.  
  257.        KeyF2 or Ctrl+R:
  258.           Performs    a  directory  tree  rescan. The directory
  259.  
  260.  
  261.  
  262. ncd               20 May 1995                4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. NCD(1)                               NCD(1)
  269.  
  270.  
  271.           database is rebuilt (home or full, depending on the
  272.           scope mode).
  273.  
  274.        KeyF3 or Ctrl+Y:
  275.           Toggle the scope mode, between home and full scope.
  276.  
  277.        Return or Enter or Ctrl+M:
  278.           Accepts the directory selected, and exits     changing
  279.           the current working directory to it.
  280.  
  281.        KeyF10 or Esc or Ctrl+X or Meta+X:
  282.           Quit. Cancels directory selection.
  283.  
  284.        KeyF1 or Ctrl+I:
  285.           Displays a little help screen.
  286.  
  287.  
  288. SHELL ALIAS/FUNCTION
  289.        ncd  is actually an executable binary and a shell alias or
  290.        function that calls it; in this way,  we     can  change  the
  291.        working    directory  of the current shell. The return value
  292.        of the binary executable is 0 if the user has  selected    a
  293.        valid  directory.  On  error  or if the operation has been
  294.        cancelled, the program returns a     value    different  to  0.
  295.        The   destination   directory  is  returned  in    the  file
  296.        $HOME/ncd_sdir allows blind changing to the directory kept
  297.        in  $HOME/ncd_sdir without testing the return value of the
  298.        program.
  299.  
  300.        Assuming that the  binary  program  is  /usr/bin/ncd,  the
  301.        shell alias/function should be the following,
  302.  
  303.        for the bash shell, define this function:
  304.  
  305.          function ncd()
  306.          {
  307.         /usr/bin/ncd $*;
  308.         if [ $? = 0 ]; then
  309.            cd "$(cat $HOME/.ncd_sdir)";
  310.         fi
  311.          }
  312.  
  313.        for  the     tcsh shell, define this alias (here shown in two
  314.        lines; actually it's just one line):
  315.  
  316.       alias ncd '/usr/bin/ncd * ;
  317.              if $? == 0 cd "`cat $HOME/.ncd_sdir`" '
  318.  
  319.        You can include this alias/function in your login  script,
  320.        or in the system wide login script. See bash(1) or tcsh(1)
  321.        manpages for help on this.
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. ncd               20 May 1995                5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. NCD(1)                               NCD(1)
  335.  
  336.  
  337. ENVIRONMENT
  338.        NCD_OPTS
  339.           You can specify default options in this environment
  340.           variable,     using    the same sintax as in the command
  341.           line. Command line options override  NCD_OPTS  val-
  342.           ues.
  343.  
  344.  
  345. FILES
  346.        $HOME/.ncd_htree home tree database.
  347.  
  348.        $HOME/.ncd_ftree full tree database.
  349.  
  350.        $HOME/.ncd_sdir directory selected in last execution.
  351.  
  352.  
  353. AUTHOR
  354.      Borja Etxebarria <borja@bips.bi.ehu.es>
  355.               <jtbecgob@s835cc.bi.ehu.es>
  356.  
  357.  
  358. BUGS
  359.        Sure a lot.
  360.  
  361.        Please,    report    any  bug  or  improvement  to  the author
  362.        Include a complete, self-contained example that will allow
  363.        the bug to be reproduced, and say which version of ncd you
  364.        are using.
  365.  
  366.  
  367. COPYRIGHT
  368.        Copyright (C) 1995, Borja Etxebarria
  369.                Basque Country University
  370.  
  371.        This program is free software;  you  can     redistribute  it
  372.        and/or modify it under the terms of the GNU General Public
  373.        License as published by the Free Software Foundation.
  374.  
  375.        This program is distributed in the hope that  it     will  be
  376.        useful, but WITHOUT ANY WARRANTY; without even the implied
  377.        warranty of MERCHANTABILITY or FITNESS  FOR  A  PARTICULAR
  378.        PURPOSE.      See  the  GNU     General  Public License for more
  379.        details.
  380.  
  381.        You should have received a copy of the GNU General  Public
  382.        License along with this program; if not, write to the Free
  383.        Software Foundation, Inc., 675  Mass  Ave,  Cambridge,  MA
  384.        02139, USA.
  385.  
  386.  
  387. SEE ALSO
  388.        bash(1), tcsh(1)
  389.  
  390.  
  391.  
  392.  
  393.  
  394. ncd               20 May 1995                6
  395.  
  396.  
  397.